﻿var http = require('http');
var fs = require('fs');
const { URL } = require('url');
// http.createServer((request,response)=>{
// 	response.writeHead(200,{'Content-Type':'text/plain'});
// 	response.write('<h1>Hello workd</h1>/n   ');

// 	response.end();
// }).listen(1002)



// http.createServer(function(req, res) {
//     //fs模块创建流文件, 名称为post.txt
//     var file = fs.createWriteStream('./input.txt');
//     ////管子 pipe自动调用了data,end等事件 writeStream/readStream
//     req.pipe(file);
//     // 当有数据流时，写入数据
//     req.on('data', function(postData){
//         console.log(postData);
//     });

//     req.on('end', function(){
//         res.end('end');
//     });
// }).listen(1002);

// http://www.jianshu.com/p/2dcfe64b63d5
// http://www.jianshu.com/p/5a80f693517f
// http://www.jianshu.com/p/293907f0d4a9
// http://blog.csdn.net/woshinannan741/article/details/51357464






























